package com.liao.base.base.utils;



/**
 * @description: <br/>
 * ThreadLocal工具类
 * 本工具类中ThreadLocal存储的是 Map<String, Object>
 * <br/>
 * @author: Qz1997
 * @create 2020/9/24 15:15
 */
public class ThreadLocalUtils {

    private final static ThreadLocal<Object> userThreadLocal = new ThreadLocal<>();

    /**
     * 设置数据到当前线程
     */
    public static void set(Object o){
        userThreadLocal.set(o);
    }

    /**
     * 获取线程中的数据
     * @return
     */
    public static Object get( ){
        return userThreadLocal.get();
    }
}


